import React, { Component, PropTypes } from 'react'
import { hashHistory } from 'react-router'

export default class Homepage extends Component {
  constructor() {
    super()
    this.gotoRegister = this.gotoRegister.bind(this)
  }
  render() {
    return (
      <div className={`rt-homepage-container`}>
        <img className={`rt-banner-img`} alt="banner" src={require('static/images/banner.png')} />

        {/*todo use carousel*/}
        <div className={`cm-notice-carousel-box`}>
          <span>公告</span>
          <span>关于开通借记卡支付通道的通知</span>
        </div>

        <div className={`cm-forget-password-text-box`}>
          <span>!</span>
          <span>忘记密码？</span>
        </div>

        <div
          className={`cm-operate-btn`}
          onClick={() => {
            hashHistory.push('/blue-ui/account')
          }}
        >
          登  录
        </div>
        <div
          className={`cm-operate-btn cm-operate-btn-ashy`}
          onClick={this.gotoRegister}
        >
          注  册
        </div>
      </div>
    )
  }
  gotoRegister() {
    const { router } = this.context
    router.push('/blue-ui/register')
  }
}

Homepage.contextTypes = {
  router: PropTypes.object,
}